using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;


public partial class CommandPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string connectionString =
        WebConfigurationManager.ConnectionStrings[
        "RCVDB2005"].ConnectionString;
        SqlConnection sqlConnection =
        new SqlConnection();        
        sqlConnection.ConnectionString =
        connectionString;
        try
        {
            sqlConnection.Open();
            SqlCommand sqlCommand  = 
            new SqlCommand();
            sqlCommand.CommandText = "select count(*) "+
            " from tblJSAccounts";
            sqlCommand.Connection = sqlConnection;
            sqlCommand.CommandType = CommandType.Text;
            Literal1.Text += "Count: " +                        
            sqlCommand.ExecuteScalar().ToString();
            Literal1.Text += "<br>";                
            sqlCommand.Dispose();
            sqlConnection.Close();            
        }
        catch (Exception ex)
        {
            Literal1.Text += "Failed:" + ex.Message;
        }
        sqlConnection.Dispose();        
    }
}
